package web.jsoft.com;

import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.jdo.PersistenceManager;
import javax.jdo.Query;
import dao.jsoft.com.PMF;
import domain.jsoft.com.User;

@ManagedBean
public class AddSuccessBean {
	//private List<User> userList; 
	
	@SuppressWarnings("unchecked")
	public List<User> getUserList(){
		
		PersistenceManager pm = PMF.get().getPersistenceManager();
		Query query = pm.newQuery(User.class);     
		
		try {         
			List<User> results = (List<User>) query.execute();         
			if (!results.isEmpty()) {             
				return  results;     
			} else {             
				return null;         
			}     } 
		finally {         
			query.closeAll();     
			pm.close();
		}		
	}
}
